/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.Date;

/**
 * <p>Project: jse2303 - Arr1
 * <p>Powered by webrx On 2023-07-12 09:30:51
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Arr1 {
    public static void main(String[] args) {
        //数组声明
        int[] a = {1, 2, 3};
        System.out.println(a.length);

        //声明数组，会自动初始化，下标索引是0 1 2 3 4 5
        int[] b = new int[6];
        System.out.println(b.length);

        var c = new int[]{10, 20, 30, 40, 50};
        System.out.println(c[0]);
        System.out.println(c[c.length - 1]);

        String[] ss = {"java", "c", "python"};
        String[] s2 = "aa,bb,cc,dd".split(",");
        char[] cs = "中国人".toCharArray();
        Date[] ds = new Date[3];

        //如果要求声明一个数组，什么数据都可以放应该怎么声明?
        Object[] objs = new Object[10];
        objs[0] = 1;
        objs[0] = 1.5;
        objs[0] = "ok";
        objs[0] = new Date();

    }
}
